package pg.objetosbasicos;

import java.awt.Color;

public class Rgb {
	public float r;
	public float g;
	public float b;
	
	public Rgb() {}
	
	public Rgb(float r, float g, float b) {
		this.r = r;
		this.g = g;
		this.b = b;
	}
	
	public Rgb(Color color) {
		this.r = color.getRed();
		this.g = color.getGreen();
		this.b = color.getBlue();
	}
	
	public Rgb normalizar() {
		Rgb result = new Rgb();
		result.r = this.r/255f;
		result.g = this.g/255f;
		result.b = this.b/255f;
		return result;
	}
}
